<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>寄生组合继承</title>
  </head>
  <body>
    <script>
        function Parent() {
            console.log("执行了一次父类的构造函数");
        }
        Parent.prototype.say = function() {
            console.log("说话了");
        }

        function Child() {
            Parent.call(this);
        }

        Child.prototype = Object.create(Parent.prototype);

        var s1 = new Child();

        s1.say();
    
    </script>
  </body>
</html>
